//
//  TLFeedViewController.m
//  FunnyVideo
//
//  Created by 李鑫 on 15/11/10.
//  Copyright © 2015年 NewEggTech. All rights reserved.
//

#import "TLFeedViewController.h"
#import "AVOSManger.h"

@implementation TLFeedViewController

- (id)initWithCoder:(nonnull NSCoder *)aDecoder{
    self = [super initWithCoder:aDecoder];
    
    if(self)
    {
        self.title = Nav_Img_Submit;
        self.isEdit = NO;
    }
    
    
    return self;
}

- (IBAction)dismissKeyboard:(id)sender {
    [self.feedTextView resignFirstResponder];
}

- (IBAction)submitFeed:(id)sender {
    if(self.feedTextView.text.length)
    {
    [[AVOSManger sharedManger] submitVideoURL:self.feedTextView.text];
    [self.navigationController popViewControllerAnimated:YES];
    [TLAlertHelper showSuccessHUDWithText:@"视频已提交审核"];
    }
    else
    [TLAlertHelper showErrorHUDWithText:@"请输入视频地址"];
}

- (void)textViewDidBeginEditing:(nonnull UITextView *)textView{
    if(!self.isEdit)
    {
        [textView setText:@""];
        self.isEdit = YES;
    }
}


- (void)viewDidLoad{
//    self.feedTextView.layer.contents = (id)
//    ;
}
@end
